package com.gzsxy.esjy.feign.cart;

import com.gzsxy.esjy.common.base.exception.impl.CustomAssert;
import com.gzsxy.esjy.feign.Product.ProductFeignService;
import com.gzsxy.esjy.service.base.dto.response.DefaultResponse;
import org.springframework.stereotype.Component;


/**
 * @author xiaolong
 * @version 1.0
 * @description: 熔断降级  （payment/feign/timeout服务提供方出现异常会进入）
 * @date 2022/2/18 15:20
 */
@Component
public class CartClientHystrix implements CartFeignService {



    @Override
    public DefaultResponse getCartByUserId(String userId) {
        CustomAssert.notTrue(false,"订单微服务远程调用购物车微服务获取订单商品失败！！！用户id:"+userId);
        return DefaultResponse.error("远程调用购物车微服务获取订单商品失败！！！");
    }

    @Override
    public DefaultResponse deleteByUserId(String userId) {
        CustomAssert.notTrue(false,"微服务远程调用失败！！！用户id:"+userId);
        return DefaultResponse.error("微服务远程调用失败！！！");
    }
}
